<include file="header"/>
<div class="wraper">
    <div class="operate">
        <p class="operate-theme pull-left note">我的浏览（<span>{BEESCRM:$count}</span>）</p>
    </div>
	<div class="product">
		<volist name="data" id="vo">
			<a href="{BEESCRM::U('base/store/goodsDetail/',array('store_id' => $storeId, 'goods_id'=>$vo['goods_id'],'origin'=>$origin,'did'=>$did))}">
			    <div class="list-info collection">
			        <div class="product-img"><img src="{BEESCRM:$vo.goods_thumb}"/></div>
			        <div class="product-info">
			            <p>{BEESCRM:$vo.goods_name}</p>
			            <p class="prize">
			                <span class="new-prize">￥{BEESCRM:$vo.goods_price}</span>
			                <if condition="session('wechat_id') neq 22"><span class="old-prize">￥{BEESCRM:$vo.goods_original_price}</span></if>
			            </p>
			        </div>
			    </div>
			</a>
		</volist>
	</div>
</div>
<include file="commonJs" />
<include file="footer" />
<script>
	$(document).ready(function(){
		var storeId = "{BEESCRM:$storeId}";
		$(document).ready(function(){
			var page = 2,
				url="/store/user/ajaxGetClickList",
				flag = true;

			$(window).scroll(function(){
				if(($(window).scrollTop() + $(window).height() > $(document).height() - 40)){
					if(flag) {
						flag = false;
						$.ajax({
							type:"GET",
							url:url,
							data:{'page': page},
							dataType:'json',
							beforeSend:function(){
								$('.data-loding').show();//显示加载时候的提示
							},
							success:function(data){
								var str ='';
								if(data.status=='S'){
									if(data.data.length > 0) {
										$('.data-loding').hide();
										$.each(data.data,function(i,k){
											var goods_id = k.goods_id;
											var url= 'base/store/goodsDetail/store_id/'+storeId+'/goods_id/'+goods_id+'/origin/{BEESCRM:$origin}/did/{BEESCRM:$did}';
											str += '<a href="'+url+'"> <div class="list-info collection">'
												+'<div class="product-img"><img src="'+k.goods_thumb+'"/></div>'
											+'<div class="product-info">'
											+'<p>'+k.goods_name+'</p>'
											+'<p class="prize">'
											+'<span class="new-prize">'+k.goods_price+'</span>'
											+'<span class="old-prize">'+k.goods_original_price+'</span>'
											+'</p>'
											+'</div>'
											+'</div></a>';
										});
										$(".product").append(str);
										page++;
										flag = true;
									} else {
										$('.data-loding').hide();
										flag = false;
									}
								}
							}
						});
					}
				}
			})
		})
	});
</script>
